package com.mall.user.controller;

import com.central.common.model.Result;
import com.mall.entity.UserRole;
import com.mall.user.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/userRole")
public class UserRoleController {

    @Autowired
    private UserRoleService userRoleService;

    @PostMapping("/addUserRole")
    public Result addUserRole(@RequestBody UserRole userRole) {
        int result = userRoleService.addUserRole(userRole);
        if (result > 0) {
            return Result.succeed("用户添加角色成功");
        }
        return Result.failed("用户添加角色失败");
    }



}
